package com.rui.cn.feignservice;


import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.IService;
import com.rui.cn.consumer.common.FeignClientConfig;
import com.rui.cn.entity.system.SysUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户 服务类
 * </p>
 *
 * @author zhang123
 * @since 2018-01-14
 */
@FeignClient(value="CLOUD-ZUUL-GATEWAY",configuration=FeignClientConfig.class)
public interface SysUserService  {
    @PostMapping(value = "/cloud/permission-proxy/sysuser/selectUserList")
    List<SysUser> selectUserList(@RequestBody Pagination page,@RequestParam("sate") Integer state);

    @GetMapping(value = "/cloud/permission-proxy/sysuser/selectByUsername/{username}")
    SysUser selectByUsername(@PathVariable("username") String username);

    @PostMapping(value = "/cloud/permission-proxy/sysuser/userList")
    Page<SysUser> userList(@RequestBody Page pagination,@RequestParam(required = false,value = "search") String search,@RequestParam(required = false,value ="sortBy") String sortBy,@RequestParam(required = false,value ="order") String order);

    @GetMapping(value = "/cloud/permission-proxy/sysuser/getUserInfo/{id}")
    SysUser getUserInfo(@PathVariable("id") Integer id);

    @PostMapping(value = "/cloud/permission-proxy/sysuser/insertMyUser")
    int insertMyUser(@RequestBody SysUser user);

    @GetMapping(value = "/cloud/permission-proxy/sysuser/selectById/{id}")
    SysUser selectById(@PathVariable("id") Integer id);

    @PutMapping(value = "/cloud/permission-proxy/sysuser/updateById")
    boolean updateById(@RequestBody SysUser user);

    @DeleteMapping(value = "/cloud/permission-proxy/sysuser/deleteBatchIds")
    boolean deleteBatchIds(@RequestBody List<Integer> integers);
}
